#include "MathLib.h"

static float MathLib2d::PointToPlaneDistance( const Point2d& point, 
                                              const Plane2d& plane )
{
    float distance = ((plane._a * point._x) + (plane._b * point._y) +
                      (-(plane._a * plane._a) - (plane._b * plane._b)) /
                      sqrt(pow(plane._a, 2) + pow(plane._b, 2)));
    return distance;
}

static void MathLib2d::RotatePoint( float& x, float& y, const float& degrees )
{
    float radians = degrees * PIOVER180;
    float cosa = cos(radians);
    float sina = sin(radians);
    float ax = x;
    float ay = y;
    x = ((ax * cosa) - (ay * sina));
    y = ((ax * sina) + (ay * cosa));
}